#ifndef HIGHLEVELCONNECTION_H_
#define HIGHLEVELCONNECTION_H_

#include <iostream>
#include <pthread.h>
using namespace std;

class HighLevelConnection {
public:
	virtual ~HighLevelConnection();
	void startListener();
	virtual string getLoc();
	virtual string setLoc(string newLoc);

protected:
	HighLevelConnection(int sockfd);
	static void* listenerEntry(void* voidConn);
	virtual void listener();
	int getSockfd();
	void closeSocket();
	int recvTCP(char*& section);
	int sendTCP(const char* message, int length);
	string location;

private:
	pthread_t thread;
	int sockfd;
	char buffer[0x1000];
};

#endif /* HIGHLEVELCONNECTION_H_ */
